package com.example.rab.config;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;

import java.time.LocalDateTime;

/**
 * @projectName: Book
 * @package: com.example.bookdev.config
 * @className: baseEntity
 * @author: zzh
 * @description: TODO
 * @version: 1.0
 */
@Data
public class baseEntity {

    @TableId(type=IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long id;


    @TableField(fill =FieldFill.INSERT,value = "createTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime creatTime;


    @TableField(fill = FieldFill.INSERT,value = "createBy")
    private String createBy;


    @TableField(fill = FieldFill.INSERT_UPDATE,value = "updateTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT_UPDATE,value = "updateBy")
    private String updateBy;


}
